package edu.pku.sei.act.main.provider;

import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.action.Action;

import edu.pku.sei.act.main.action.ArchiModelerEditorActionGroup;
import edu.pku.sei.act.main.action.ArchiModelerOpenDiagramAction;
import edu.pku.sei.act.main.project.ArchiModelerProject;
import edu.pku.sei.act.model.mote.MoteForPackage;
import edu.pku.sei.gmp.editor.action.GMPEditorActionGroup;
import edu.pku.sei.gmp.editor.action.IEditorActionProvider;
import edu.pku.sei.gmp.model.shape.GMPDiagram;

public class ArchiModelerEditorActionProvider implements IEditorActionProvider {

	@Override
	public GMPEditorActionGroup getActionGroup(EditPartViewer partViewer,
			ActionRegistry defaultRegistry, GMPDiagram diagram) {
		return new ArchiModelerEditorActionGroup(partViewer,defaultRegistry,diagram);
	}
	
	public Action getDoubleClickAction(Object selectedElement) {
		if (selectedElement instanceof MoteForPackage) {
			return new ArchiModelerOpenDiagramAction(selectedElement);
		}
		return null;
	}

	@Override
	public String getProjectNature() {

		return ArchiModelerProject.PROJECT_NATURE;
		
	}

}
